const Koa = require("koa");
const app = new Koa();

const KoaRouter = require("koa-router");
const router = new KoaRouter();

// 解析请求体的中间件
const KoaBodyParser = require("koa-bodyparser");

app.use(KoaBodyParser());

router.get("/users", async (ctx) => {});
router.post("/users", async (ctx) => {});
router.put("/users", async (ctx) => {});
router.delete("/users", async (ctx) => {});

app.use(router.routes());

app.listen(3002, () => {
    console.log("Koa 服务器已启动");
});
